package com.feibiao.computer;
public class JieC implements Operate {
    private int result;
    public double compute(double operator)throws Exception{
        if (operator < 0){
            throw new Exception("Sorry,负数没有阶乘");
        }else if(operator == 0){
            result = 1;
        }else{
            result = (int)operator;
            for (int i = result - 1;i >= 1;i --){
                result *= i;
            }
        }
        return result;
    }
    @Override
    public double compute(double operator1, double operator2) throws Exception {
        return 0;
    }
}
